Type-Checking Revisited: Modular Error-Handling

نویسنده

  • T. B. Dinesh
چکیده

Static-semantics determines the validity of a program, while a type-checker provides more speciic type error information. Type-checkers are speciied based on the static semantics speciication, for the purpose of identifying and presenting type errors in invalid programs. We discuss a style of algebraically specifying the static semantics of a language which facilitates automatic generation of a type-checker and a language speciic error reporter. Such a speciication can also be extended in a modular manner to yield human-readable error messages. Static-semantics of a language determines the validity of a program written in that language. Type-checking of a program, to be useful in practice, should not only indicate whether a given program is valid or not, but also summarize the type errors and show the location of the erroneous constructs which caused the errors. Thus, specifying a type-checker that is useful in practice results in (textually) modifying the speciication of static semantics to \knit" in the reporting of the nature and location of type errors. Knitting such reporting information about the details of type-checking into the speciication of static semantics is a lot of work and is error prone. We discuss diierent styles of specifying type-checkers and present a spec-iication style which facilitates the generation of an error reporting tool that automatically locates the erroneous constructs. This speciication style advocates the concise and abstract speciication of static semantics. A signiicant advantage of this style is that error handling (providing a summary of type errors) need not be knit in the type-checker speciication, but can be speciied as a modular extension to the static semantics. To illustrate our speciication style, we use the toy language Pico 1]. Pico programs consists of declarations followed by statements. The syntax and a brief description of Pico can be found in the appendix. The small size of Pico allows us to discuss diierent styles used in the speciications in detail. In Section 2, we brieey discuss algebraic speciications and term rewriting systems, and introduce the speciication formalism used in this paper. In Section 3 we examine a \classical" style of specifying static semantics of Pico 1,

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Modeling Language for Hybrid Systems

The general hybrid systems modeling language (HSML) described here will serve two purposes: to define formally what is meant by the term “hybrid system”, and to provide the basis for language-based “front ends” for hybrid system simulation environments. Features of HSML include: hierarchical, modular construction of models; consistent yet distinctive definition of continuous-time, discrete-time...

متن کامل

Rigorous Handling of State Events in matlab

Previous research in the area of modeling and simulation of hybrid systems led to the development of a general hybrid systems modeling language (hsml) that has been described elsewhere. Features of hsml include: hierarchical, modular construction of models from components; consistent yet distinctive definition of continuoustime, discrete-time and logic-based components; prioritized scheduling o...

متن کامل

A Typed Interrupt Calculus

Most real-time systems require responsive interrupt handling. Programming of interrupt handlers is challenging: in order to ensure responsiveness, it is often necessary to have interrupt processing enabled in the body of lower priority handlers. It would be a programming error to allow the interrupt handlers to interrupt each other in a cyclic fashion; it could lead to an unbounded stack. Until...

متن کامل

A Fault Tolerant Carry Select Adder with Modular Self Checking Scheme

This paper presents Fault Tolerant Carry Select Adder (FT-CSA), most widely used type of adder, based on the self checking scheme with modular architecture. The error recovery capability is derived using generic input/output combination of carry select adder with predetermined fault and error set. The experimental results show that proposed FT-CSA has nearly 50% overhead compared with the typic...

متن کامل

Functional Pearl: Control to Correct A recipe for robustness

Making a program robust is often a recipe for making it ugly: the core logic becomes hopelessly entwined with error handling, and quickly dwarfed by it. The concerns are hard to separate, since error checking may depend on earlier bits of core logic, and the core logic may assume error-free input. In this pearl we show, through two distinct but related examples, how to wield first-class control...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1993